<template>
   <div id="app">
       父组件 <br />
       <div id="divBox" v-if='showText'>测试文本</div>
       <button @click="getText">获取div内容</button>
   </div>
</template>
<script>
export default {
    data(){
        return {
            showText:false
        }
    },
    methods:{
        getText(){
            this.showText = true
            this.$nextTick(()=>{
                var innerHTML = document.getElementById("divBox").innerHTML
                console.log(1,innerHTML)
            })
           
        }
    }
}
</script>
<style>
</style>


 
 
